
// #ifndef VUE3
// 这边是不基于vue3.0的
import Vue from 'vue'
import App from './App'
import api from '@/api/api.js'; // 引入公共api
import globalUrl from '@/common/globalUrl.js'
import util from '@/common/util.js'
import store from './store'

Vue.config.productionTip = false
Vue.prototype.$api = api;
Vue.prototype.$store = store;
Vue.prototype.$globalUrl = globalUrl;
Vue.prototype.$util = util;

Vue.prototype.isBarHeight = function() {
	return new Promise((resolve, reject) => {
		var that = this
		var isTemp = {}
		uni.getSystemInfo({
			success(res) {
				let totalTopHeight = 68
				if (res.model.indexOf('iPhone X') !== -1) {
					totalTopHeight = 88
				} else if (res.model.indexOf('iPhone') !== -1) {
					totalTopHeight = 64
				}
				isTemp['statusBarHeight'] = res.statusBarHeight
				isTemp['titleBarHeight'] = totalTopHeight - res.statusBarHeight
				isTemp['allHeight'] = totalTopHeight
				resolve(isTemp)
			},
			fail(e) {
				reject(e)
			}
		})
	})
}
// Vue.config.ignoredElements.push('wx-open-subscribe');

App.mpType = 'app'

const app = new Vue({
  ...App
})
app.$mount()
// #endif

// #ifdef VUE3
// 这边是基于vue3.0的
import { createSSRApp } from 'vue'
import App from './App.vue'
export function createApp() {
  const app = createSSRApp(App)
  return {
	store,
    app
  }
}
// #endif